from typing import *


class Solution:
    def numEquivDominoPairs(self, dominoes: List[List[int]]) -> int:

        mp = DefaultDict(int)
        ans = 0
        for a, b in dominoes:
            c = tuple(sorted([a, b]))
            ans += mp[c]
            mp[c] += 1
        return ans


print(tuple(sorted((2, 1))))
